package com.example.demo.controller;

import com.example.demo.dto.Empoyee;
import com.example.demo.dto.WmsStock;
import com.example.demo.mapper.MybatisMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api")
public class MybatisController {

    @Autowired
    MybatisMapper mybatisMapper;

    @GetMapping("/all")
    public List<Empoyee> selectAll() {
        return mybatisMapper.selectEmpoyee();
    }

    @GetMapping("/all/{id}")
    public Empoyee selectById(@PathVariable("id") Integer id) {
        return mybatisMapper.selectById(id);
    }

    /**
     * 获取 wmsStock 数据
     */
    @GetMapping("/all/stock")
    public List<WmsStock> selectStock() {
        return mybatisMapper.selectStockData();
    }


}
